<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CategoryAdmin.aspx.cs" Inherits="Admin_CategoryAdmin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="Panel1" runat="server" Height="100px" Style="position: relative; left: 0px; top: 0px;" Width="512px">
            <table style="position: relative; left: 0px; width: 496px; top: 0px;">
                <tr>
                    <td colspan="2">
                        Book Category Administrator</td>
                </tr>
                <tr>
                    <td style="width: 90px">
                        Category name:</td>
                    <td style="width: 136px">
                        <asp:TextBox ID="txtCategoryname" runat="server" Style="position: relative"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required Field"
                            ValidationGroup="A"></asp:RequiredFieldValidator></td>
                        
                </tr>
                <tr>
                    <td colspan="2" style="height: 26px">
                        <asp:Button ID="btnAdd" runat="server" Style="position: relative" Text="Add" OnClick="btnAdd_Click" /></td>
                </tr>
            </table>
        </asp:Panel>
        <br />
        Book Category List:<br />
        <asp:GridView ID="dgrCategories" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryId"
            OnRowEditing="dgrCategories_RowEditing" OnRowUpdating="dgrCategories_RowUpdating"
            Style="position: relative" OnRowCancelingEdit="dgrCategories_RowCancelingEdit" OnRowDeleting="dgrCategories_RowDeleting">
            <Columns>
                <asp:TemplateField HeaderText="Category ID">                  
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("CategoryID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category Name">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("CategoryName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CategoryName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
    
    </div>
    </form>
</body>
</html>
